package com.shelpe.services.simbasync.dao;

import com.shelpe.services.simbasync.model.RptKeyword;
import com.shelpe.services.simbasync.model.RptKeywordExample;
import com.shelpe.services.simbasync.model.RptKeywordKey;

import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface RptKeywordMapper {
    int countByExample(@Param("user_id") String userId, @Param("example") RptKeywordExample example);

    int deleteByExample(@Param("user_id") String userId, @Param("example")RptKeywordExample example);

    int deleteByPrimaryKey(@Param("user_id") String userId, @Param("key")RptKeywordKey key);

    int insert(RptKeyword record);
    
    int insertBatch(@Param("user_id") String userId, @Param("itemList")List<RptKeyword> list);

    int insertSelective(RptKeyword record);

    List<RptKeyword> selectByExample(@Param("user_id") String userId, @Param("example")RptKeywordExample example);

    RptKeyword selectByPrimaryKey(@Param("user_id") String userId, @Param("key")RptKeywordKey key);

    int updateByExampleSelective(@Param("record") RptKeyword record, @Param("example") RptKeywordExample example);

    int updateByExample(@Param("record") RptKeyword record, @Param("example") RptKeywordExample example);

    int updateByPrimaryKeySelective(RptKeyword record);

    int updateByPrimaryKey(RptKeyword record);
    
    Date getLastTimeFromRpt(@Param("user_id") String userId, @Param("campaign_id") long campaignId, @Param("adgroup_id") long adgroupId);
    
    Date getLastTimeFromRptScore(@Param("user_id") String userId, @Param("adgroup_id") long adgroupId);
    
    int existRptKeywordsTable(String tableName);
    
    int createRptKeywordsTable(@Param("user_id") String userId);
    
    int alterRptKeywordsTable(@Param("user_id") String userId);
}